<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>专家详细信息</title>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript" src="${res}/js/proposal/irisPrpPrepare.js"></script>
<script type="text/javascript" src="${res}/js/validate/irisvalidator.js"></script>
<script type="text/javascript" src="${res}/js/autodisckey/autodisckey.js"></script>

<style type="text/css">
	.input_width1 { width:45px }
	.input_width { width:130px }
	.select_width { width:143px }
	.table_td td {border:0}
	/* .long_input{ width:642px } */
    .selectWidth4{width:300px}
</style>
<script type="text/javascript">
var type = "${param.type}";
var parentTable = parent.$("#"+"${param.parentTab}");	//父页面的表格
var selectRadio = $();									//父页面选中的单选框
var selectTr = $();										//父页面选中的行

if(type=="edit") {
	selectRadio = parentTable.find(":radio:checked");
	selectTr = selectRadio.parents("tr");
}

$(function(){
	$("#fragment-tab1 :text,#fragment-tab1 [type='date']").addClass("input_width");
	$("#fragment-tab2 :text,#fragment-tab2 [type='date']").addClass("input_width1");

	$("#fragment-tab1 select").addClass("select_width");
	
	var submitpsn=selectTr.find("[name$='submit_psn']");//标示是否是申报人
	
	if(type=="edit"){
		
		$("input:not(:radio:button),textarea").each(function(){

			var id=$(this).attr("name");
			if(id==null || id==""){
				return true;
			}
			var parentObj=selectTr.find("[name$='/"+id+"']");
			var value="";
			if(parentObj.is("span")){
				value=parentObj.text();
			}else{
				value=parentObj.val();
			}
			//if($(this).is("input"))//初始化input框 不包括radio
			$(this).val(value);
		});
		
		$(":radio").each(function(){//初始化radio框
			var name=$(this).attr("name");
		
			
			var value=$("[name='"+name+"_value']").val();
			if(($(this).val()).indexOf(value)>-1){
				$(this).attr("checked",true);
			}
			
		});
		
		changeCardType();
		
		
			$("input,select,textarea").each(function(){
				if(!$(this).attr("class")||$(this).attr("class").indexOf("notdisabled")==-1)
					$(this).attr("disabled","true");
			});
			$("a,img").removeAttr("onclick");
			$(".color_red").css("display","none");
			if(parent.thickbox_title)
				parent.$("#TB_ajaxWindowTitle").html(parent.thickbox_title);
			else
			parent.$("#TB_ajaxWindowTitle").html("查看专家信息");
		//}
		
	}
});

function loadAjaxSelect(selectId,url,params,varParm){
	$.ajax( {
		url : url,
		type : 'post',
		dataType:'json',
		data : params,
		success : function(data) {
			
			for(var i=0;i<data.length;i++){
				var value=data[i].id;
				var text=data[i].name;		
				$("#"+selectId).append("<option value='"+value+"'>"+text+"</option>");
				

			}
			if(type=="edit"){//如果是修改，才需要初始化select框的值
				var selectValue=$("[name='"+selectId+"_value']").val();
				$("#"+selectId+" option").each(function(i,obj){
					if($(obj).val()==selectValue){
						setTimeout(function() {
							$(obj).attr("selected",true);
						}, 1);
					}
				});
			}
			
			
		}
	});
	}

function setDegree(){
	
	var degreeText=$("#degree").children("option").filter(":selected").text();

	if(degreeText=="博士"){
		$("#degree_country_required").show();
		$("#degree_year_required").show();
		var itemClass=$("#degree_country").attr("class");
		if(itemClass.indexOf("required")==-1)
			$("#degree_country").attr("class",$("#degree_country").attr("class")+" required");
		
		itemClass=$("#degree_year").attr("class");
		if(itemClass.indexOf("required")==-1)
			$("#degree_year").attr("class",$("#degree_year").attr("class")+" required");
	}else{//关闭最高学位验证
		$("#degree_country_required").hide();
		$("#degree_year_required").hide();
		$("#degree_country").attr("class",$("#degree_country").attr("class").replace("required",""));
		$("#degree_year").attr("class",$("#degree_year").attr("class").replace("required",""));
	}
}

function changeCardType(){
	var cardTypeObj = $("[name='card_type_value']");
	var cardCodeObj = $("[name='card_code']");
	
	if(cardTypeObj.val()=="1"){
		cardCodeObj.addClass("idCard");
		cardCodeObj.attr("label","身份证");
	} else {
		cardCodeObj.removeClass("idCard");
		cardCodeObj.attr("label","证件号码");
	}
}
$(function(){
	var tab=$('#content_file_code8').val();
	if( tab==''){
		$("#orgphotoImg").attr("src",res_app+'/images/app/photo_01.jpg');

	}
	{
		$("#orgphotoImg").attr("src", ctx + '/file/ajax-filedownload?fileCode=' + $("#content_file_code8").val());
	}
})


</script>

</head>
<body style="overflow-x:hidden;overflow-y:auto;">

<div id="tabnav">
	<ul>
		<li class="down" id="tab1" onclick="changeTab(this.id)">
			<a href="###"><span>专家个人信息</span></a>
		</li>

		<li  id="tab2" onclick="changeTab(this.id)">
			<a href="###"><span>专家经费</span></a>
		</li>
	</ul>
</div>

<div class="tab_box" id="fragment-tab1">
	<table class="t_css " width="100%" border="0" cellpadding="0" label="专家个人信息" cellspacing="1">
		<col style="width: 20%" />
		<col style="width: 20%" />
		<col style="width: 15%" />
		<col style="width: 25%" />
		<col style="width: 20%" />
		<security:authorize ifAnyGranted="A_MENU_MANAGE_19">
			<input type="hidden" name="depart_code" id="depart_code"  value="" >
		</security:authorize>

		<tr>
			<td nowrap align="right"><span class="color_red">*</span>专家姓名：</td>
			<td >
				<input name="zh_name" label="专家姓名" type="text"  class="input_text required maxlength:25"  value="" maxlength="25"/>
			</td>
			<td align='right'>
				<span class="color_red">*</span>
				出生日期：
			</td>

			<td>
				<cpt:date id="birthday"  value="" className="required date beforeToday" label="出生日期"   name="birthday" ></cpt:date>
				<input type='hidden' name='age' id='age' value=""/>
			</td>

			<td align="center" rowspan="6">
				<div id="uploadsuccess8">

					<img id="orgphotoImg" src="${res_app}/images/app/photo_01.jpg"  style="width:130px;height:159px" />

					<%--<c:set var="file_code8"></c:set>
                    <c:choose>
                        <c:when test="${empty param.fileCode || param.fileCode==''}">
                            <img src="${res_app}/images/app/photo_01.jpg"  style="width:130px;height:159px" />
                        </c:when>
                        <c:otherwise>
                            <img src="${ctx}/file/ajax-filedownload?fileCode=${param.fileCode}"  style="width:130px;height:159px" />
                        </c:otherwise>
                    </c:choose>--%>
					<%--<a href="#" style="cursor: pointer;" onclick="cilckFile('org')"><br/><span style="color: blue;">[上传照片]</span></a><BR />
					<span class="color_red">照片规格：358像素X441像素（小于2M）</span>--%>
				</div>
				<div id="file8" style="text-align:center">
					<input type="text" name="file_code8" id="content_file_code8"  name="file_code8" value="" />
				</div></td>
		</tr>
		<tr>
			<td align="right"><span class="color_red">*</span>性别：</td>
			<td>
				<cpt:select key="gender1" cacheable="false"   value="" id="gender" name="gender"    onChange="initControlValue(this.id)"   label="性别" />
				<input type="hidden" id="gender_value" name="gender_value" value="" class="required"  label="性别"/>
				<input type="hidden" id="gender_name" name="gender_name" value="" />
			</td>


			<td align="right"><span class="color_red">*</span>国别地区：</td>
			<td>
				<cpt:select id="region"  key="country" name="region" onChange="initControlValue(this.id)" label="国别地区"></cpt:select>
				<input type="hidden" name="region_value" value=""  class="required"  label="国别地区"/>
				<input type="hidden" name="region_name" value="" />
			</td>
		</tr>
		<tr>
			<td align="right"><span class="color_red">*</span>职务职称：</td>
			<td>

				<cpt:tree key="prof_title" cacheable="false" readonly="true" value="" id="prof_title" name="prof_title"  showPattern="all" shieldPattern="-1" onClick="initTreeValueExt"   label="职称" />
				<input type="hidden" id="prof_title_value" name="prof_title_value" value="" class="required"  label="职务职称"/>
				<input type="hidden" id="prof_title_name" name="prof_title_name" value="" />
			</td>


			<td align="right"><span class="color_red">*</span>专业：</td>
			<td>
				<input type="text" label="专业" name="major_work" class="required" maxlength="50"/>
			</td>
		</tr>

		<tr>
			<td align='right'>
				<span class="color_red">*</span>
				国外工作单位：
			</td>
			<td colspan="3">
				<input type="text" name="org_name" maxlength="100" required class="required selectWidth4  " label="国外工作单位" />
			</td>
		</tr>
		<tr>
			<td align="right"><span class="color_red" >*</span>学位：</td>
			<td>
				<cpt:select id="degree"  key="degree"  onChange="initControlValue(this.id);"></cpt:select>
				<input type="hidden" name="degree_value" value="" label="学位" class="required">
				<input type="hidden" name="degree_name" value="">
			</td>
		</tr>

		<tr>
			<td align="right"><span class="color_red">*</span>通讯地址：</td>
			<td  colspan="3">
				<input type="text" name="tech_department_address" maxlength="30" required class="required selectWidth4" label="通讯地址" />
			</td>
		</tr>
		<tr>
			<td align="right">
				<span class="color_red">*</span>护照号码：
			</td>
			<td>
				<input type="text" name="card_code" label="护照号码" class="input_text  required" maxlength="30"/>
			</td>
			<td align="right"><span class="color_red">*</span>电话：</td>
			<td>
				<input type="text" name="tel_work" maxlength="20"  class="required "   label="电话" />
			</td>
		</tr>
		<tr>

			<td align="right"><span class="color_red">*</span>所属专家组织：</td>
			<td >
				<input type="text" name="subordinate_expert_organizations" maxlength="30"  class="required "   label="所属专家组织" />
			</td>
			<td align="right"><span class="color_red">*</span>电子邮箱：</td>
			<td>
				<input type="text" name="email" required class="required email" label="电子邮箱" />
			</td>

		</tr>
		<tr>

			<td align="right"><span class="color_red">*</span>在华天数：</td>
			<td >
				<input type="text"  name="days_to_china" maxlength="11" onfocus="InitInput.setNumber(this,11,0,0);" class="required "   label="在华天数" />
			</td>
			<td align="right"><span class="color_red">*</span>起止日期：</td>
			<td colspan="4">
				<input type="text" label="起止日期" name="start_end_date" class="required " maxlength="50"/>
			</td>
		</tr>

		<tr class="li_1">
			<td align="left" colspan="8"><strong>教育经历</strong></td>
		</tr>
		<tr class="li_2">
			<td colspan="8">
				<textarea rows="8"  cols="135"  class="input_textarea required  maxlength:300"   name='summary9'  label="引智成果来源及示范推广价值"></textarea>
				<input type="hidden" name="summary9_hidden" id="summary9_hidden" value=""/>
			</td>
		</tr>
		<tr class="li_1">
			<td align="left" colspan="8"><strong>工作经历</strong></td>
		</tr>
		<tr class="li_2">
			<td colspan="8">
				<textarea rows="8" cols="135"  name='summary10' class="input_textarea required  maxlength:300"   label="示范推广工作年度计划内容、进度安排"></textarea>
				<input type="hidden" name="summary10_hidden" id="summary10_hidden" value=""/>
			</td>
		</tr>
		<tr class="li_1">
			<td align="left" colspan="8"><strong>代表性成果/主要成就</strong></td>
		</tr>
		<tr class="li_2">
			<td colspan="8">
				<textarea rows="8"  cols="135" name='summary11' class="input_textarea required  maxlength:300"   label="配套技术措施与组织措施"></textarea>
				<input type="hidden" name="summary11_hidden" id="summary11_hidden" value=""/>
			</td>
		</tr>
		<tr class="li_1">
			<td align="left" colspan="8"><strong> 其他（包括获得的重要奖项、在国际学术组织兼职、在国际学术会议做重要报告等情况）</strong></td>
		</tr>
		<tr class="li_2">
			<td colspan="8">
				<textarea rows="8" cols="135"  name='summary12' class="input_textarea required  maxlength:300"   label="绩效目标"></textarea>
				<input type="hidden" name="summary12_hidden" id="summary12_hidden" value="" />
			</td>
		</tr>
	</table>
</div>

<div class="tab_box" id="fragment-tab2" style="display: none">
	<table class="t_css table01" width="100%" border="0" cellpadding="0" label="专家经费" cellspacing="1">
		<col style="width: 8%" />
		<%--<col style="width: 7%" />--%>
		<col style="width: 8%" />
		<col style="width: 8%" />
		<col style="width: 8%" />
		<col style="width: 8%" />
		<col style="width: 8%" />
		<col style="width: 8%" />
		<col style="width: 7%" />
		<col style="width: 7%" />
		<col style="width: 7%" />
		<col style="width: 16%" />
		<col style="width: 7%" />
		<tr>
			<td align="center" rowspan="2">专家姓名</td>
			<%--<td align="center" rowspan="2">国籍</td>--%>
			<td align="center" rowspan="2">来华次数</td>
			<td align="center" rowspan="2">工作天数</td>
			<td align="center" rowspan="2">国籍旅费</td>
			<td align="center" rowspan="2">住宿费</td>
			<td align="center" rowspan="2">城市间交通费</td>
			<td align="center" rowspan="2">专家补贴</td>
			<td align="center" rowspan="2">专家生活费</td>
			<td align="center" rowspan="2">讲课费</td>
			<td align="center" rowspan="2">零用费</td>
			<td align="center" colspan="2">工薪</td>
			<td align="center" rowspan="2">小计</td>
		</tr>
		<tr>
			<td align="center" >合同约定金额</td>
			<td align="center">申请资助</td>

		</tr>

		<tr>
			<td >
				<input name="zh_name" label="专家姓名" type="text"  class="input_text required maxlength:25"  value="" maxlength="25"/>
			</td>
			<%--<td >

                <cpt:select id="region"  key="country" name="region" onChange="initControlValue(this.id)" label="国别地区"></cpt:select>
                <input type="hidden" name="region_value" value=""  class="required"  label="国籍"/>
                <input type="hidden" name="region_name" value="" />

                &lt;%&ndash;<input name="zh_name" label="国籍" type="text"  class="input_text required maxlength:25"  value="" maxlength="25"/>&ndash;%&gt;
            </td>--%>
			<td >
				<input name="number_of_visits" label="来华次数" type="text"  class="input_text required " onfocus="InitInput.setNumber(this,9,0,0)"  value="" />
			</td>
			<td >
				<input name="work_date" label="工作天数" type="text"  class="input_text required "  value="" onfocus="InitInput.setNumber(this,9,0,0)"/>
			</td>
			<td >
				<input name="nationality_travel_expenses" label="国籍旅费" id="nationality_travel_expenses"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"
					   onfocus="InitInput.setNumber(this,9,2,2)" type="text"  class="input_text required "  value="" />
			</td>
			<td >
				<input name="hotel_expense" label="住宿费" id="hotel_expense"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   onfocus="InitInput.setNumber(this,9,2,2)" type="text"  class="input_text required "  value="" />
			</td>
			<td >
				<input name="transportation_charges" id="transportation_charges"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   label="城市间交通费" onfocus="InitInput.setNumber(this,9,2,2)" type="text"  class="input_text required "  value="" />
			</td>
			<td >
				<input name="expert_subsidies" id="expert_subsidies"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   label="专家补贴" type="text"  onfocus="InitInput.setNumber(this,9,2,2)" class="input_text required "  value="" />
			</td>
			<td >
				<input name="expert_living_expenses" id="expert_living_expenses"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   label="专家生活费" type="text" onfocus="InitInput.setNumber(this,9,2,2)"  class="input_text required "  value="" />
			</td>
			<td >
				<input name="lecture_fees" label="讲课费" id="lecture_fees"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   type="text" onfocus="InitInput.setNumber(this,9,2,2)"  class="input_text required "  value="" />
			</td>
			<td >
				<input name="petty_cash" label="零用费" id="petty_cash"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   type="text" onfocus="InitInput.setNumber(this,9,2,2)"  class="input_text required "  value="" />
			</td>
			<td >
				<input name="contract_agreed_amount" id="contract_agreed_amount"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   label="合同约定金额" type="text"  onfocus="InitInput.setNumber(this,9,2,2)" class="input_text required "  value="" />
			</td>
			<td >
				<input name="apply_for_subsidy" id="apply_for_subsidy"
					   onchange="countFundAuto('','nationality_travel_expenses,hotel_expense,transportation_charges,expert_subsidies,expert_living_expenses,lecture_fees,petty_cash,contract_agreed_amount,apply_for_subsidy','subtotal')"

					   label="申请资助" type="text"  onfocus="InitInput.setNumber(this,9,2,2)" class="input_text required "  value="" />
			</td>
			<td >
				<input name="subtotal" id="subtotal" label="小计" type="text"  class="input_text required gray" disabled="disabled" onfocus="InitInput.setNumber(this,9,2,2)" value="" />
			</td>
		</tr>

	</table>
</div>
	<table width="100%" align="center">
		<tr>
			<td>
				&nbsp;<input type="button" id="cancel" class="button_01 notdisabled" value="关闭" onclick="parent.tb_remove();">
			</td>
		</tr>
	</table>
	<br />
</body>
</html>